package com.ljw.spring.annotation.test;

import com.ljw.spring.annotation.aop.MathCalculator;
import com.ljw.spring.annotation.bean.User;
import com.ljw.spring.annotation.conf.ConfigOfAOP;
import com.ljw.spring.annotation.ext.ExtConfig;
import com.ljw.spring.annotation.ext.MyApplicationEvent;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @FileName IOCTest_AOP
 * @Description TODO
 * @Author ljw
 * @Date 2021/2/3 15:49
 * @Version 1.0
 */
public class IOCTest_Ext {

    @Test
    public void test01(){
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ExtConfig.class);
       // MyApplicationEvent event = context.getBean(MyApplicationEvent.class);
        User user = context.getBean(User.class);
        MyApplicationEvent event = new MyApplicationEvent(user);
        context.publishEvent(event);
    }
}
